﻿<cfsilent>
	<cfscript>
	
		event.setArg("pageTitle", "教师门户 - 教学任务");
		
		sessionAdvice = getProperty("serviceFactory").getBean("sessionAdvice");
		mathAdvice = getProperty("serviceFactory").getBean("senateMathAdvice");
		termProp = getProperty("serviceFactory").getBean("termPropertyAdvice");
		taskProp = getProperty("serviceFactory").getBean("taskPropertyAdvice");

		teacherId = sessionAdvice.getAutherUserID();
		
		termId = event.getArg("TermID"); /* 运行学期 */
		academicYear = event.getArg("AcademicYear");
		academicTerm = event.getArg("AcademicTerm");
		

		termIdPK = event.getArg("TermIDPK"); /* 排课学期 */
		academicYearPK = event.getArg("AcademicYearPK");
		academicTermPK = event.getArg("AcademicTermPK");

		rs_planTaskForCourse = queryNew("course_name, task_limite, task_chooesd, campus_name, task_week, task_time, task_place, institute_short, task_prop, tsk_id, course_code, course_credit");
		rs_commonTaskForCourse = queryNew("course_name, task_limite, task_chooesd, campus_name, task_week, task_time, task_place, institute_short, task_prop, tsk_id, course_code, course_credit");
		rs_openTaskForCourse = queryNew("course_name, task_limite, task_chooesd, campus_name, task_week, task_time, task_place, institute_short, task_prop, tsk_id, course_code, course_credit");
		rs_sportTaskForCourse = queryNew("course_name, task_limite, task_chooesd, campus_name, task_week, task_time, task_place, institute_short, task_prop, tsk_id, course_code, course_credit");

		/* 计划任务 */
		sql = "SELECT
					t_course.course_name, cidx, task_limite,
					task_chooesd, campus_name, task_week,
					CASE WHEN task_time is null then '-' else task_time END task_time, 
					CASE WHEN task_place is null then '-' else task_place END task_place,
					t_institute.institute_short,
					task_prop, tsk_id,
					t_course.course_code, t_course.course_credit 
				FROM 
					t_task a 
					INNER JOIN t_course ON t_course.cid = a.cid 
					INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
					INNER JOIN t_campus ON t_campus.campus_id = a.campus_id 
					INNER JOIN t_term ON t_term.term_id = a.term_id 
					INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
				WHERE 
					a.term_id = :termId 
					AND 
					(
						a.tch_id=:teacherId 
						OR 
						a.tch_id_sec=:teacherId 
						OR 
						a.tch_id_ace=:teacherId 
					)
				ORDER BY 
					t_course.course_name, cidx ";
						
		queryObj = new query( datasource=application.dnsSlave );
			
		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		queryObj.addParam( name="teacherId", value=teacherId, cfsqltype="cf_sql_varchar" );
			
		rs_planTask = queryObj.execute( sql=sql ).getResult();
		
			
		/* 全校通选课 */
		sql = "SELECT
					t_course.course_name, cidx, task_limite,
					task_chooesd, campus_name, task_week,
					CASE WHEN task_time is null then '-' else task_time END task_time, 
					CASE WHEN task_place is null then '-' else task_place END task_place,
					t_institute.institute_short,
					task_prop, tsk_id,
					t_course.course_code, t_course.course_credit 
				FROM 
					t_common_task a 
					INNER JOIN t_course ON t_course.cid = a.cid 
					INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
					INNER JOIN t_campus ON t_campus.campus_id = a.campus_id 
					INNER JOIN t_term ON t_term.term_id = a.term_id 
					INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
				WHERE 
					a.term_id = :termId 
					AND 
					(
						a.tch_id=:teacherId 
						OR 
						a.tch_id_sec=:teacherId 
						OR 
						a.tch_id_ace=:teacherId 
					)
					AND 
					EXISTS (
						SELECT 1 FROM t_task_arrange b  
						WHERE a.tsk_id = b.task_id AND a.term_id = :termId 
						) 
				ORDER BY 
					t_course.course_name, cidx ";
						
		queryObj = new query( datasource=application.dnsSlave );
			
		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		queryObj.addParam( name="teacherId", value=teacherId, cfsqltype="cf_sql_varchar" );
			
		rs_commonTask = queryObj.execute( sql=sql ).getResult();

			
		/* 单开班课程 */
		sql = "SELECT
					t_course.course_name, cidx, task_limite,
					task_chooesd, campus_name, task_week,
					CASE WHEN task_time is null then '-' else task_time END task_time, 
					CASE WHEN task_place is null then '-' else task_place END task_place,
					t_institute.institute_short,
					task_prop, tsk_id,
					t_course.course_code, t_course.course_credit 
				FROM 
					t_reopen_task a 
					INNER JOIN t_course ON t_course.cid = a.cid 
					INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
					INNER JOIN t_campus ON t_campus.campus_id = a.campus_id 
					INNER JOIN t_term ON t_term.term_id = a.term_id 
					INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
				WHERE
					a.term_id = :termId 
					AND 
					(
						a.tch_id=:teacherId  
						OR  
						a.tch_id_sec=:teacherId 
						OR 
						a.tch_id_ace=:teacherId 
					)
					AND 
					EXISTS (
						SELECT 1 FROM t_task_arrange b  
						WHERE a.tsk_id = b.task_id AND a.term_id = :termId 
						) 
				ORDER BY 
						t_course.course_name, cidx ";
						
		queryObj = new query( datasource=application.dnsSlave );
			
		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		queryObj.addParam( name="teacherId", value=teacherId, cfsqltype="cf_sql_varchar" );
			
		rs_openTask = queryObj.execute( sql=sql ).getResult();
			
			
		/* 体育项目课程 */
		sql = "SELECT
					t_course.course_name, cidx, task_limite,
					task_chooesd, campus_name, task_week,
					CASE WHEN task_time is null then '-' else task_time END task_time, 
					CASE WHEN task_place is null then '-' else task_place END task_place,
					t_institute.institute_short,
					task_prop, tsk_id,
					t_course.course_code, t_course.course_credit 
				FROM 
					t_sport_task a 
					INNER JOIN t_course ON t_course.cid = a.cid 
					INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
					INNER JOIN t_campus ON t_campus.campus_id = a.campus_id 
					INNER JOIN t_term ON t_term.term_id = a.term_id 
					INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
				WHERE
					a.term_id = :termId 
					AND 
					(
						a.tch_id=:teacherId 
						OR 
						a.tch_id_sec=:teacherId 
						OR 
						a.tch_id_ace=:teacherId 
					)
					AND 
					EXISTS (
						SELECT 1 FROM t_task_arrange b  
						WHERE a.tsk_id = b.task_id AND a.term_id = :termId 
						) 
				ORDER BY 
					t_course.course_name, cidx ";
						
		queryObj = new query( datasource=application.dnsSlave );
			
		queryObj.addParam( name="termId", value=termId, cfsqltype="cf_sql_char" );
		queryObj.addParam( name="teacherId", value=teacherId, cfsqltype="cf_sql_varchar" );
			
		rs_sportTask = queryObj.execute( sql=sql ).getResult();


		if ( termId neq termIdPK ) {
			
			/* 有跨学期课表 */

			/* 计划任务 */
			sql = "SELECT
						t_course.course_name, cidx, task_limite,
						task_chooesd, campus_name, task_week,
						CASE WHEN task_time is null then '-' else task_time END task_time, 
						CASE WHEN task_place is null then '-' else task_place END task_place,
						t_institute.institute_short,
						task_prop, tsk_id,
						t_course.course_code, t_course.course_credit 
					FROM 
						t_task a 
						INNER JOIN t_course ON t_course.cid = a.cid 
						INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
						INNER JOIN t_campus ON t_campus.campus_id = a.campus_id 
						INNER JOIN t_term ON t_term.term_id = a.term_id 
						INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
					WHERE 
						a.term_id = :termId 
						AND 
							(
								a.tch_id=:teacherId 
								OR 
								a.tch_id_sec=:teacherId 
								OR 
								a.tch_id_ace=:teacherId 
							)
						AND 
						EXISTS (
							SELECT 1 FROM t_task_arrange b  
							WHERE a.tsk_id = b.task_id AND a.term_id = :termId 
							) 
					ORDER BY 
						t_course.course_name, cidx ";
						
			queryObj = new query( datasource=application.dnsSlave );
			
			queryObj.addParam( name="termId", value=termIdPK, cfsqltype="cf_sql_char" );
			queryObj.addParam( name="teacherId", value=teacherId, cfsqltype="cf_sql_varchar" );
			
			rs_planTaskForCourse = queryObj.execute( sql=sql ).getResult();
			
			/* 全校通选课 */
			sql = "SELECT
						t_course.course_name, cidx, task_limite,
						task_chooesd, campus_name, task_week,
						CASE WHEN task_time is null then '-' else task_time END task_time, 
						CASE WHEN task_place is null then '-' else task_place END task_place,
						t_institute.institute_short,
						task_prop, tsk_id,
						t_course.course_code, t_course.course_credit 
					FROM 
						t_common_task a 
						INNER JOIN t_course ON t_course.cid = a.cid 
						INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
						INNER JOIN t_campus ON t_campus.campus_id = a.campus_id 
						INNER JOIN t_term ON t_term.term_id = a.term_id 
						INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
					WHERE 
						a.term_id = :termId 
						AND 
							(
								a.tch_id=:teacherId 
								OR 
								a.tch_id_sec=:teacherId 
								OR 
								a.tch_id_ace=:teacherId 
							)
						AND 
						EXISTS (
							SELECT 1 FROM t_task_arrange b  
							WHERE a.tsk_id = b.task_id AND a.term_id = :termId 
							) 
					ORDER BY 
						t_course.course_name, cidx ";
						
			queryObj = new query( datasource=application.dnsSlave );
			
			queryObj.addParam( name="termId", value=termIdPK, cfsqltype="cf_sql_char" );
			queryObj.addParam( name="teacherId", value=teacherId, cfsqltype="cf_sql_varchar" );
			
			rs_commonTaskForCourse = queryObj.execute( sql=sql ).getResult();
			
			/* 单开班课程 */
			sql = "SELECT
						t_course.course_name, cidx, task_limite,
						task_chooesd, campus_name, task_week,
						CASE WHEN task_time is null then '-' else task_time END task_time, 
						CASE WHEN task_place is null then '-' else task_place END task_place,
						t_institute.institute_short,
						task_prop, tsk_id,
						t_course.course_code, t_course.course_credit 
					FROM 
						t_reopen_task a 
						INNER JOIN t_course ON t_course.cid = a.cid 
						INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
						INNER JOIN t_campus ON t_campus.campus_id = a.campus_id 
						INNER JOIN t_term ON t_term.term_id = a.term_id 
						INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
					WHERE
							a.term_id = :termId 
						AND 
							(
								a.tch_id=:teacherId  
								OR  
								a.tch_id_sec=:teacherId 
								OR 
								a.tch_id_ace=:teacherId 
							)
						AND 
						EXISTS (
							SELECT 1 FROM t_task_arrange b  
							WHERE a.tsk_id = b.task_id AND a.term_id = :termId 
							) 
					ORDER BY 
						t_course.course_name, cidx ";
						
			queryObj = new query( datasource=application.dnsSlave );
			
			queryObj.addParam( name="termId", value=termIdPK, cfsqltype="cf_sql_char" );
			queryObj.addParam( name="teacherId", value=teacherId, cfsqltype="cf_sql_varchar" );
			
			rs_openTaskForCourse = queryObj.execute( sql=sql ).getResult();
			
			
			/* 体育项目课程 */
			sql = "SELECT
						t_course.course_name, cidx, task_limite,
						task_chooesd, campus_name, task_week,
						CASE WHEN task_time is null then '-' else task_time END task_time, 
						CASE WHEN task_place is null then '-' else task_place END task_place,
						t_institute.institute_short,
						task_prop, tsk_id,
						t_course.course_code, t_course.course_credit 
					FROM 
						t_sport_task a 
						INNER JOIN t_course ON t_course.cid = a.cid 
						INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
						INNER JOIN t_campus ON t_campus.campus_id = a.campus_id 
						INNER JOIN t_term ON t_term.term_id = a.term_id 
						INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
					WHERE
						a.term_id = :termId 
						AND 
							(
								a.tch_id=:teacherId 
								OR 
								a.tch_id_sec=:teacherId 
								OR 
								a.tch_id_ace=:teacherId 
							)
						AND 
						EXISTS (
							SELECT 1 FROM t_task_arrange b  
							WHERE a.tsk_id = b.task_id AND a.term_id = :termId 
							) 
					ORDER BY 
						t_course.course_name, cidx ";
						
			queryObj = new query( datasource=application.dnsSlave );
			
			queryObj.addParam( name="termId", value=termIdPK, cfsqltype="cf_sql_char" );
			queryObj.addParam( name="teacherId", value=teacherId, cfsqltype="cf_sql_varchar" );
			
			rs_sportTaskForCourse = queryObj.execute( sql=sql ).getResult();
			
			
		}
		
		
		/* 判断当前显示课表内容 */
		currentTab = event.getArg("TabID", "labCurrent");
		
		if ( rs_planTaskForCourse.recordCount or rs_commonTaskForCourse.recordCount or rs_openTaskForCourse.recordCount or rs_sportTaskForCourse.recordCount ) {
			currentTab = event.getArg("TabID", "labCourseArrange");
		}
		
		targetArgs = structNew();
	
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('courseTable')#</cfoutput>"><i class="mrs img btnPublish"></i><span class="uiButtonText">个人课表</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 program"></i>教学任务
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">
				
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labCurrent">class="active"</cfif> id="labCurrent" tabTarget="Current">当前学期</span>
						<cfif rs_planTaskForCourse.recordCount or rs_commonTaskForCourse.recordCount or rs_openTaskForCourse.recordCount or rs_sportTaskForCourse.recordCount >
							<span <cfif currentTab eq "labCourseArrange">class="active"</cfif> id="labCourseArrange" tabTarget="CourseArrange">排课学期</span>
						</cfif>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>
				
				<div id="Current" class="tabContent">
                
					<div class="noticeBlock">
						<h3>学期教学任务</h3>
						<p>
							<span class="img icon16x16 message"></span>
							在<em><cfoutput>#academicYear#</cfoutput>-<cfoutput>#academicTerm#</cfoutput></em>学期您需要承担教学任务安排如下.</p>
						<hr/>
					</div>

					<cfif rs_planTask.recordCount>
						<!-- planTask -->
						<div class="noticeBlock">
							<h3>计划课程</h3>
							<hr/>
						</div>
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="30"></td>
									<td>部门</td>
									<td>课程</td>
									<td>课程号</td>
									<td>课序号</td>
									<td>学分</td>
									<td>选课人数</td>
									<td>周次</td>
									<td>校区</td>
									<td>上课时间</td>
									<td>上课地点</td>
									<td width="18"></td>
								</tr>
							</thead>
							<tbody>
								<cfset row = 0 />
                                <cfloop query="rs_planTask">
									<cfset row++ />
									<cfset structInsert(targetArgs, "TSK", rs_planTask.tsk_id, true) />
									<cfset taskProp.parseProperty(rs_planTask.task_prop) />
									<tr class="editRows <cfif taskProp.getCancel() eq "1">cancelRow</cfif>" rowid="<cfoutput>#rs_planTask.course_name#</cfoutput>">
										<td class="index">P.<cfoutput>#row#</cfoutput></td>
										<td><cfoutput>#rs_planTask.institute_short#</cfoutput></td>
										<td><cfoutput>#rs_planTask.course_name#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_planTask.course_code#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_planTask.cidx#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#numberFormat(rs_planTask.course_credit, '_.__')#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_planTask.task_chooesd# / #rs_planTask.task_limite#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_planTask.task_week#</cfoutput></span></td>
										<td><cfoutput>#rs_planTask.campus_name#</cfoutput></td>
										<cfif taskProp.getCancel() eq "0">
                                                  	<cfset writeLog( text=rs_planTask.task_time ) />
												<td><cfoutput>#replace(mathAdvice.convertTaskTime(rs_planTask.task_time), ",", "<br/>", "all")#</cfoutput></td>
												<td><cfoutput>#replace(rs_planTask.task_place, ",", "<br/>", "all")#</cfoutput></td>
											<cfelse>
												<td colspan="2">教学班已撤销</td>
										</cfif>
										<td>
											<cfif taskProp.getCancel() eq "0">
												<a title="查看选课名单" href="<cfoutput>#buildURL('planTask', targetArgs)#</cfoutput>" class="stat details"></a>
											</cfif>
										</td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						<!-- /planTask -->
					</cfif>
					
					<cfif rs_commonTask.recordCount>
						<!-- commonTask -->
						<div class="noticeBlock">
							<h3>全校通选课</h3>
							<hr/>
						</div>
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="30"></td>
									<td>部门</td>
									<td>课程</td>
									<td>课程号</td>
									<td>课序号</td>
									<td>学分</td>
									<td>选课人数</td>
									<td>周次</td>
									<td>校区</td>
									<td>上课时间</td>
									<td>上课地点</td>
									<td width="18"></td>
								</tr>
							</thead>
							<tbody>
								<cfset row = 0 />						
                                <cfloop query="rs_commonTask">
									<cfset row++ />
									<cfset structInsert(targetArgs, "TSK", rs_commonTask.tsk_id, true) />
									<cfset taskProp.parseProperty(rs_commonTask.task_prop) />
									<tr class="editRows <cfif taskProp.getCancel() eq "1">cancelRow</cfif>" rowid="<cfoutput>#rs_commonTask.course_name#</cfoutput>">
										<td class="index">C.<cfoutput>#row#</cfoutput></td>
										<td><cfoutput>#rs_commonTask.institute_short#</cfoutput></td>
										<td><cfoutput>#rs_commonTask.course_name#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_commonTask.course_code#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_commonTask.cidx#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#numberFormat(rs_commonTask.course_credit , '_.__')#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_commonTask.task_chooesd# / #rs_commonTask.task_limite#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_commonTask.task_week#</cfoutput></span></td>
										<td><cfoutput>#rs_commonTask.campus_name#</cfoutput></td>
										<cfif taskProp.getCancel() eq "0">
												<td><cfoutput>#replace(mathAdvice.convertTaskTime(rs_commonTask.task_time), ",", "<br/>", "all")#</cfoutput></td>
												<td><cfoutput>#replace(rs_commonTask.task_place, ",", "<br/>", "all")#</cfoutput></td>
											<cfelse>
												<td colspan="2">教学班已撤销</td>
										</cfif>
										<td>
											<cfif taskProp.getCancel() eq "0">
												<a title="查看选课名单" href="<cfoutput>#buildURL('commonTask', targetArgs)#</cfoutput>" class="stat details"></a>
											</cfif>
										</td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						<!-- /commonTask -->
					</cfif>
					
					<cfif rs_openTask.recordCount>
						<!-- openTask -->
						<div class="noticeBlock">
							<h3>单开班课程</h3>
							<hr/>
						</div>
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="30"></td>
									<td>部门</td>
									<td>课程</td>
									<td>课程号</td>
									<td>课序号</td>
									<td>学分</td>
									<td>选课人数</td>
									<td>周次</td>
									<td>校区</td>
									<td>上课时间</td>
									<td>上课地点</td>
									<td width="18"></td>
								</tr>
							</thead>
							<tbody>
								<cfset row = 0 />
                                <cfloop query="rs_openTask">
									<cfset row++ />
									<cfset structInsert(targetArgs, "TSK", rs_openTask.tsk_id, true) />
									<cfset taskProp.parseProperty(rs_openTask.task_prop) />
									<tr class="editRows <cfif taskProp.getCancel() eq "1">cancelRow</cfif>" rowid="<cfoutput>#rs_openTask.course_name#</cfoutput>">
										<td class="index">R.<cfoutput>#row#</cfoutput></td>
										<td><cfoutput>#rs_openTask.institute_short#</cfoutput></td>
										<td><cfoutput>#rs_openTask.course_name#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_openTask.course_code#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_openTask.cidx#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#numberFormat(rs_openTask.course_credit, '_.__')#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_openTask.task_chooesd# / #rs_openTask.task_limite#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_openTask.task_week#</cfoutput></span></td>
										<td><cfoutput>#rs_openTask.campus_name#</cfoutput></td>
										<cfif taskProp.getCancel() eq "0">
												<td><cfoutput>#replace(mathAdvice.convertTaskTime(rs_openTask.task_time), ",", "<br/>", "all")#</cfoutput></td>
												<td><cfoutput>#replace(rs_openTask.task_place, ",", "<br/>", "all")#</cfoutput></td>
											<cfelse>
												<td colspan="2">教学班已撤销</td>
										</cfif>
										<td>
											<cfif taskProp.getCancel() eq "0">
												<a title="查看选课名单" href="<cfoutput>#buildURL('openTask', targetArgs)#</cfoutput>" class="stat details"></a>
											</cfif>
										</td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						<!-- /openTask -->
					</cfif>
					
					<cfif rs_sportTask.recordCount>
						<!-- sportTask -->
						<div class="noticeBlock">
							<h3>体育项目课程</h3>
							<hr/>
						</div>
						<table class="UIEditable">
							<thead>
								<tr>
									<td width="30"></td>
									<td>部门</td>
									<td>课程</td>
									<td>课程号</td>
									<td>课序号</td>
									<td>学分</td>
									<td>选课人数</td>
									<td>周次</td>
									<td>校区</td>
									<td>上课时间</td>
									<td>上课地点</td>
									<td width="18"></td>
								</tr>
							</thead>
							<tbody>
								<cfset row = 0 />
                                <cfloop query="rs_sportTask">
									<cfset row++ />
									<cfset structInsert(targetArgs, "TSK", rs_sportTask.tsk_id, true) />
									<cfset taskProp.parseProperty(rs_sportTask.task_prop) />
									<tr class="editRows <cfif taskProp.getCancel() eq "1">cancelRow</cfif>" rowid="<cfoutput>#rs_sportTask.course_name#</cfoutput>">
										<td class="index">T.<cfoutput>#row#</cfoutput></td>
										<td><cfoutput>#rs_sportTask.institute_short#</cfoutput></td>
										<td><cfoutput>#rs_sportTask.course_name#</cfoutput></td>
										<td><span class="numeric"><cfoutput>#rs_sportTask.course_code#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_sportTask.cidx#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#numberFormat(rs_sportTask.course_credit, '_.__')#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_sportTask.task_chooesd# / #rs_sportTask.task_limite#</cfoutput></span></td>
										<td><span class="numeric"><cfoutput>#rs_sportTask.task_week#</cfoutput></span></td>
										<td><cfoutput>#rs_sportTask.campus_name#</cfoutput></td>
										<cfif taskProp.getCancel() eq "0">
												<td><cfoutput>#replace(mathAdvice.convertTaskTime(rs_sportTask.task_time), ",", "<br/>", "all")#</cfoutput></td>
												<td><cfoutput>#replace(rs_sportTask.task_place, ",", "<br/>", "all")#</cfoutput></td>
											<cfelse>
												<td colspan="2">教学班已撤销</td>
										</cfif>
										<td>
											<cfif taskProp.getCancel() eq "0">
												<a title="查看选课名单" href="<cfoutput>#buildURL('sportTask', targetArgs)#</cfoutput>" class="stat details"></a>
											</cfif>
										</td>
									</tr>
								</cfloop>
							</tbody>
						</table>
						<!-- /sportTask -->
					</cfif>
					
				</div>
				
				<cfif rs_planTaskForCourse.recordCount or rs_commonTaskForCourse.recordCount or rs_openTaskForCourse.recordCount or rs_sportTaskForCourse.recordCount>

					<div id="CourseArrange" class="tabContent">

						<div class="noticeBlock">
							<h3>预计安排授课教学任务</h3>
							<p>
								<span class="img icon16x16 message"></span>
								在<em><cfoutput>#academicYearPK#</cfoutput>-<cfoutput>#academicTermPK#</cfoutput></em>学期您可能需要承担的教学任务安排如下.</p>
							<hr/>
						</div>

						<cfif rs_planTaskForCourse.recordCount>
							<!-- planTask -->
							<div class="noticeBlock">
								<h3>计划课程</h3>
								<hr/>
							</div>
							<table class="UIEditable">
								<thead>
									<tr>
										<td width="30"></td>
										<td>部门</td>
										<td>课程</td>
										<td>课程号</td>
										<td>课序号</td>
										<td>学分</td>
										<td>选课人数</td>
										<td>周次</td>
										<td>校区</td>
										<td>上课时间</td>
										<td>上课地点</td>
										<td width="18"></td>
									</tr>
								</thead>
								<tbody>
									<cfset row = 0 />
                                    <cfloop query="rs_planTaskForCourse">
										<cfset row++ />
										<cfset structInsert(targetArgs, "TSK", rs_planTaskForCourse.tsk_id, true) />
										<cfset taskProp.parseProperty(rs_planTaskForCourse.task_prop) />
										<tr class="editRows <cfif taskProp.getCancel() eq "1">cancelRow</cfif>" rowid="<cfoutput>#rs_planTaskForCourse.course_name#</cfoutput>">
											<td class="index">P.<cfoutput>#row#</cfoutput></td>
											<td><cfoutput>#rs_planTaskForCourse.institute_short#</cfoutput></td>
											<td><cfoutput>#rs_planTaskForCourse.course_name#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#rs_planTaskForCourse.course_code#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_planTaskForCourse.cidx#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#numberFormat(rs_planTaskForCourse.course_credit, '_.__')#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_planTaskForCourse.task_chooesd# / #rs_planTaskForCourse.task_limite#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_planTaskForCourse.task_week#</cfoutput></span></td>
											<td><cfoutput>#rs_planTaskForCourse.campus_name#</cfoutput></td>
											<cfif taskProp.getCancel() eq "0">
													<td><cfoutput>#replace(mathAdvice.convertTaskTime(rs_planTaskForCourse.task_time), ",", "<br/>", "all")#</cfoutput></td>
													<td><cfoutput>#replace(rs_planTaskForCourse.task_place, ",", "<br/>", "all")#</cfoutput></td>
												<cfelse>
													<td colspan="2">教学班已撤销</td>
											</cfif>
											<td>
												<cfif taskProp.getCancel() eq "0">
													<a title="查看选课名单" href="<cfoutput>#buildURL('planTask', targetArgs)#</cfoutput>" class="stat details"></a>
												</cfif>
											</td>
										</tr>
									</cfloop>
								</tbody>
							</table>
							<!-- /planTask -->
						</cfif>

						<cfif rs_commonTaskForCourse.recordCount>
							<!-- commonTask -->
							<div class="noticeBlock">
								<h3>全校通选课</h3>
								<hr/>
							</div>
							<table class="UIEditable">
								<thead>
									<tr>
										<td width="30"></td>
										<td>部门</td>
										<td>课程</td>
										<td>课程号</td>
										<td>课序号</td>
										<td>学分</td>
										<td>选课人数</td>
										<td>周次</td>
										<td>校区</td>
										<td>上课时间</td>
										<td>上课地点</td>
										<td width="18"></td>
									</tr>
								</thead>
								<tbody>
									<cfset row = 0 />
                                    <cfloop query="rs_commonTaskForCourse">
										<cfset row++ />
										<cfset structInsert(targetArgs, "TSK", rs_commonTaskForCourse.tsk_id, true) />
										<cfset taskProp.parseProperty(rs_commonTaskForCourse.task_prop) />
										<tr class="editRows <cfif taskProp.getCancel() eq "1">cancelRow</cfif>" rowid="<cfoutput>#rs_commonTaskForCourse.course_name#</cfoutput>">
											<td class="index">C.<cfoutput>#row#</cfoutput></td>
											<td><cfoutput>#rs_commonTaskForCourse.institute_short#</cfoutput></td>
											<td><cfoutput>#rs_commonTaskForCourse.course_name#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#rs_commonTaskForCourse.course_code#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_commonTaskForCourse.cidx#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#numberFormat(rs_commonTaskForCourse.course_credit, '_.__')#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_commonTaskForCourse.task_chooesd# / #rs_commonTaskForCourse.task_limite#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_commonTaskForCourse.task_week#</cfoutput></span></td>
											<td><cfoutput>#rs_commonTaskForCourse.campus_name#</cfoutput></td>
											<cfif taskProp.getCancel() eq "0">
													<td><cfoutput>#replace(mathAdvice.convertTaskTime(rs_commonTaskForCourse.task_time), ",", "<br/>", "all")#</cfoutput></td>
													<td><cfoutput>#replace(rs_commonTaskForCourse.task_place, ",", "<br/>", "all")#</cfoutput></td>
												<cfelse>
													<td colspan="2">教学班已撤销</td>
											</cfif>
											<td>
												<cfif taskProp.getCancel() eq "0">
													<a title="查看选课名单" href="<cfoutput>#buildURL('commonTask', targetArgs)#</cfoutput>" class="stat details"></a>
												</cfif>
											</td>
										</tr>
									</cfloop>
								</tbody>
							</table>
							<!-- /commonTask -->
						</cfif>
						
						<cfif rs_openTaskForCourse.recordCount>
							<!-- openTask -->
							<div class="noticeBlock">
								<h3>单开班课程</h3>
								<hr/>
							</div>
							<table class="UIEditable">
								<thead>
									<tr>
										<td width="30"></td>
										<td>部门</td>
										<td>课程</td>
										<td>课程号</td>
										<td>课序号</td>
										<td>学分</td>
										<td>选课人数</td>
										<td>周次</td>
										<td>校区</td>
										<td>上课时间</td>
										<td>上课地点</td>
										<td width="18"></td>
									</tr>
								</thead>
								<tbody>
									<cfset row = 0 />
                                    <cfloop query="rs_openTaskForCourse">
										<cfset row++ />
										<cfset structInsert(targetArgs, "TSK", rs_openTaskForCourse.tsk_id, true) />
										<cfset taskProp.parseProperty(rs_openTaskForCourse.task_prop) />
										<tr class="editRows <cfif taskProp.getCancel() eq "1">cancelRow</cfif>" rowid="<cfoutput>#rs_openTaskForCourse.course_name#</cfoutput>">
											<td class="index">R.<cfoutput>#row#</cfoutput></td>
											<td><cfoutput>#rs_openTaskForCourse.institute_short#</cfoutput></td>
											<td><cfoutput>#rs_openTaskForCourse.course_name#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#rs_openTaskForCourse.course_code#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_openTaskForCourse.cidx#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#numberFormat(rs_openTaskForCourse.course_credit, '_.__')#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_openTaskForCourse.task_chooesd# / #rs_openTaskForCourse.task_limite#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_openTaskForCourse.task_week#</cfoutput></span></td>
											<td><cfoutput>#rs_openTaskForCourse.campus_name#</cfoutput></td>
											<cfif taskProp.getCancel() eq "0">
													<td><cfoutput>#replace(mathAdvice.convertTaskTime(rs_openTaskForCourse.task_time), ",", "<br/>", "all")#</cfoutput></td>
													<td><cfoutput>#replace(rs_openTaskForCourse.task_place, ",", "<br/>", "all")#</cfoutput></td>
												<cfelse>
													<td colspan="2">教学班已撤销</td>
											</cfif>
											<td>
												<cfif taskProp.getCancel() eq "0">
													<a title="查看选课名单" href="<cfoutput>#buildURL('openTask', targetArgs)#</cfoutput>" class="stat details"></a>
												</cfif>
											</td>
										</tr>
									</cfloop>
								</tbody>
							</table>
							<!-- /openTask -->
						</cfif>
						
						<cfif rs_sportTaskForCourse.recordCount>
							<!-- sportTask -->
							<div class="noticeBlock">
								<h3>体育项目课程</h3>
								<hr/>
							</div>
							<table class="UIEditable">
								<thead>
									<tr>
										<td width="30"></td>
										<td>部门</td>
										<td>课程</td>
										<td>课程号</td>
										<td>课序号</td>
										<td>学分</td>
										<td>选课人数</td>
										<td>周次</td>
										<td>校区</td>
										<td>上课时间</td>
										<td>上课地点</td>
										<td width="18"></td>
									</tr>
								</thead>
								<tbody>
									<cfset row = 0 />
                                    <cfloop query="rs_sportTaskForCourse"> 
										<cfset row++ />
										<cfset structInsert(targetArgs, "TSK", rs_sportTaskForCourse.tsk_id, true) />
										<cfset taskProp.parseProperty(rs_sportTaskForCourse.task_prop) />
										<tr class="editRows <cfif taskProp.getCancel() eq "1">cancelRow</cfif>" rowid="<cfoutput>#rs_sportTaskForCourse.course_name#</cfoutput>">
											<td class="index">T.<cfoutput>#row#</cfoutput></td>
											<td><cfoutput>#rs_sportTaskForCourse.institute_short#</cfoutput></td>
											<td><cfoutput>#rs_sportTaskForCourse.course_name#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#rs_sportTaskForCourse.course_code #</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_sportTaskForCourse.cidx#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#numberFormat(rs_sportTaskForCourse.course_credit, '_.__')#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_sportTaskForCourse.task_chooesd# / #rs_sportTaskForCourse.task_limite#</cfoutput></span></td>
											<td><span class="numeric"><cfoutput>#rs_sportTaskForCourse.task_week#</cfoutput></span></td>
											<td><cfoutput>#rs_sportTaskForCourse.campus_name#</cfoutput></td>
											<cfif taskProp.getCancel() eq "0">
													<td><cfoutput>#replace(mathAdvice.convertTaskTime(rs_sportTaskForCourse.task_time), ",", "<br/>", "all")#</cfoutput></td>
													<td><cfoutput>#replace(rs_sportTaskForCourse.task_place, ",", "<br/>", "all")#</cfoutput></td>
												<cfelse>
													<td colspan="2">教学班已撤销</td>
											</cfif>
											<td>
												<cfif taskProp.getCancel() eq "0">
													<a title="查看选课名单" href="<cfoutput>#buildURL('sportTask', targetArgs)#</cfoutput>" class="stat details"></a>
												</cfif>
											</td>
										</tr>
									</cfloop>
								</tbody>
							</table>
							<!-- /sportTask -->
						</cfif>
						
					</div>
				</cfif>
				
			</div>
		</li>
	</ul>
</div>

